<template>
    <div class="activity-card" @click="goToActivity">
      <img :src="activity.image" alt="活动图片" class="card-image">
      <div class="card-content">
        <h3 class="card-title">{{ activity.title }}</h3>
        <p class="card-time">{{ activity.time }}</p>
        <p class="card-location">{{ activity.location }}</p>
        <div class="card-footer">
          <span class="card-status">{{ activity.status }}</span>
          <span class="card-people">{{ activity.participants }}人已报名</span>
        </div>
      </div>
    </div>
  </template>
  
  <script>
  export default {
    props: {
      activity: {
        type: Object,
        required: true
      }
    },
    methods: {
      goToActivity() {
        this.$router.push(`/activity/${this.activity.id}`)
      }
    }
  }
  </script>
  
  <style scoped>
  .activity-card {
    display: flex;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
  }
  
  .activity-card:hover {
    transform: translateY(-3px);
  }
  
  .card-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
  }
  
  .card-content {
    padding: 12px;
    flex: 1;
  }
  
  .card-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
  }
  
  .card-time, .card-location {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
  }
  
  .card-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
  }
  
  .card-status {
    color: #f56c6c;
  }
  
  .card-people {
    color: #909399;
  }
  </style>
  